echo "JAVA_OPTS: "$JAVA_OPTS
echo "CMD: "$CMD
run_str="java"

<#if mode == "jib">
if [[ ${r'${JAVA_OPTS}'} ]]; then
    run_str=${r'${run_str}'}" "${r'${JAVA_OPTS}'}" "
else
    run_str=${r'${run_str}'}" -Xms1g -Xmx1g "
fi

run_str=${r'${run_str}'}" -cp /app/resources:/app/classes:/app/libs/* "
run_str=${r'${run_str}'}" ${mainClass} "
<#else>
if [[ ${r'${JAVA_OPTS}'} ]]; then
    run_str=${r'${run_str}'}" "${r'${JAVA_OPTS}'}" -jar"
else
    run_str=${r'${run_str}'}" -Xms1g -Xmx1g -jar"
fi

run_str=${r'${run_str}'}" ${jarName} "
</#if>

if [[ ${r'${CMD}'} ]]; then
    run_str=${r'${run_str}'}" "${r'${CMD}'}
fi

if [[ ${r'$1'} ]]; then
    run_str=${r'${run_str}'}" "${r'$1'}
fi

# execute
echo "execute cmd is: "${r'${run_str}'}
${r'${run_str}'}